home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / EleOfC++ vrs 0.1 / Scribble / TScribbleDoc.h < prev   
Encoding:
C/C++ Source or Header  |  1991-07-14  |  1.3 KB  |  54 lines  |  [TEXT/KAHL]

  1. /*
  2. ** This is the TScribbleDoc class declaration.  This class is an adaptation of 
  3. ** the class of the same name in the book, Elements of C++ Macintosh 
  4. ** Programming, by Dan Weston.
  5. **
  6. ** Copyright © 1991 Mark Gross (gross@kaman.com and
  7. ** RR2, Box 84, Clayville, NY 13322);         
  8. ** this file may be published everywhere, but no charge
  9. ** may be made for its use.  Please contact me about any bugs found.
  10. ** I'm also looking for Macintosh development work, so drop me a line
  11. ** if you think I could help.  
  12. */
  13.  
  14. #define        _H_TScribbleDoc
  15. #define        min(A,B)    ((A) < (B) ? (A) : (B) )
  16. #include    "TDoc.h"
  17.  
  18. typedef enum {patBlack, patGray, patWhite}penPat;
  19.  
  20.  
  21. struct    TScribbleDoc:TDoc
  22. {
  23.     PicHandle    fPic;
  24.     short        fPenSize;
  25.  
  26.     penPat        fPattern;
  27.     
  28. /*
  29. ** new and modified member functions follow
  30. */
  31.  
  32.     TDoc*    Init(OSType theCreator, SFReply *reply);
  33.     void    SetPenSize(short p);
  34.     void    SetPenPat(penPat P);
  35.     short    GetPenSize(void);
  36.     penPat    GetPenPat(void);
  37.     void    DoContent(EventRecord* theEvent);
  38.     void    Draw(Rect *r);
  39.     OSType    GetDocType(void);
  40.     Boolean    WriteDocFile(short refNum);
  41.     Boolean    ReadDocFile(short refNum);
  42.     Boolean    DoDocMenuCommand(short menuID, short menuItem);
  43.     Boolean    CanSaveAs(void);
  44.     void    AdjustDocMenus(void);
  45.     void    TogglePenMenu(Boolean enable);
  46.     void    Activate(void);
  47.     void    Deactivate(void);
  48.     Boolean    DoClose(void);
  49.     
  50. };/* end of class decloration*/
  51.  
  52.     
  53.     
  54.